package com.example.newdemo.view.bind;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

import com.example.newdemo.IBooksAidl;

public class MyService extends Service {

    IBooksAidl.Stub booksStub;

    @Override
    public IBinder onBind(Intent intent) {
        System.out.println("=====onBind=====");
        return  booksStub;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        booksStub = new IBooksAidl.Stub() {
            @Override
            public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {

            }

            @Override
            public int getTypes() throws RemoteException {
                return 90;
            }
        };

    }

    /**
     * 服务销毁的时候调用
     */
    @Override
    public void onDestroy() {
        // TODO Auto-generated method stub
        System.out.println("=========onDestroy======");
        super.onDestroy();
    }

}
